source_apt_debian(){
    mkdir -p /etc/apt/sources.d/
echo 'deb http://mirrors.ustc.edu.cn/debian/ buster main
deb-src http://mirrors.ustc.edu.cn/debian/ buster main

deb http://mirrors.ustc.edu.cn/debian-security buster/updates main
deb-src http://mirrors.ustc.edu.cn/debian-security buster/updates main


deb http://mirrors.ustc.edu.cn/debian/ buster-updates main
deb-src http://mirrors.ustc.edu.cn/debian/ buster-updates main

deb http://mirrors.ustc.edu.cn/debian/ buster-backports main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ buster-backports main non-free contrib' > /etc/apt/sources.list 
    sed -i "s@buster@`cat /etc/os-release | grep ^VERSION_CODE | awk -F '=' '{print $2}'`@g" /etc/apt/sources.list 
    apt update
    if [[ ! -e '/apt.tools' ]];then
        service_install 'apt-transport-https ca-certificates  gnupg gnupg2 curl gnupg2 software-properties-common sudo'
    fi
    echo 'tools=y' > /apt.tools
    ##判断是否通过1参传入镜像站替换
	if [[ -n "$1" ]];then
		sed -i 's#http://mirrors.ustc.edu.cn#$1#g' /etc/apt/sources.list
        sed -i 's#http://mirrors.ustc.edu.cn#$1#g' /etc/apt/sources.list
	else
		green_zt "[ Debian${System_version} ]使用中国科技大学镜像站"
	fi
}
source_apt_ubuntu(){
echo 'deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal main restricted

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates main restricted

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates multiverse

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports main restricted universe multiverse


deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security multiverse' > /etc/apt/sources.list
sed -i "s@focal@`cat /etc/os-release  | grep ^UBUNTU_CODENAME | sed -e 's/UBUNTU_CODENAME=//'`@g" /etc/apt/sources.list
cat /etc/apt/sources.list
}
##备份源
source_apt_bak(){
    mkdir -p /etc/apt/sources.list.d/
    if [[ -f '/etc/apt/sources.list.bak' ]];then
        green_zt "文件[ /etc/apt/sources.list.bak ]已备份"
        rm -f /etc/apt/sources.list
    else
        cp /etc/apt/sources.list /etc/apt/sources.list.bak
        rm -f /etc/apt/sources.list
    fi
}
source_apt_docker-ce(){
    service_install " gnupg gnupg2 "
    rm -f gpg
    curl -fsSL https://mirrors.huaweicloud.com/docker-ce/linux/${System_Type}/gpg | apt-key add -
    rm -f gpg
    curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/${System_Type}/gpg | apt-key add -
    add-apt-repository "deb [arch=amd64] https://mirrors.huaweicloud.com/docker-ce/linux/${System_Type} $(lsb_release -cs) stable"
    ##判断是否通过1参传入镜像站替换
	if [[ -n "$1" ]];then
		sed -i "s#https://mirrors.huaweicloud.com/docker-ce/#${1}/docker-ce/#g" /etc/apt/sources.list
	else
        sed -i 's#https://mirrors.huaweicloud.com/docker-ce/#https://mirrors.aliyun.com/docker-ce/#g' /etc/apt/sources.list
		green_zt "[ Docker-ce源 ]使用阿里云镜像站"
	fi
    # sed -i "s#/docker-ce/linux/debian#/docker-ce/linux/${System_Type}#g" /etc/apt/sources.list
}
source_apt_k8s(){
    rm -f gpg
    curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
EOF
    apt update
    ##判断是否通过1参传入镜像站替换
	if [[ -n "$1" ]];then
		sed -i 's#https://mirrors.aliyun.com#$1#g' /etc/apt/sources.list
	else
		green_zt "[K8S]使用阿里云镜像站"
	fi
}